package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.StockBillLog;
import com.yami.shop.bean.param.StockBillExportParam;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 出入库明细
 *
 * @author LGH
 * @date 2021-09-09 13:11:15
 */
public interface StockBillLogMapper extends BaseMapper<StockBillLog> {

    /**
     * 分页获取出入库明细信息
     *
     * @param page
     * @param stockBillLog
     * @return
     */
    IPage<StockBillLog> pageByParams(@Param("page") PageParam<StockBillLog> page, @Param("stockBillLog") StockBillLog stockBillLog);

    /**
     * 获取导出出入库明细信息列表
     *
     * @param stockBillLog
     * @return
     */
    List<StockBillExportParam> listExportStockBillLog(@Param("stockBillLog") StockBillLog stockBillLog);

    /**
     * 根据id获取
     *
     * @param stockBillLogId
     * @return
     */
    StockBillLog getByStockBillLogId(@Param("stockBillLogId") Long stockBillLogId);

    /**
     * 获取出入库明细
     * @param stockBillLogId
     * @return
     */
    StockBillLog info(@Param("stockBillLogId") Long stockBillLogId);

    /**
     * 删除空的库存记录
     */
    void removeEmptyLog();
}
